<?php

declare(strict_types=1);

namespace App\Chat\Request;

use Mine\MineFormRequest;

class TalkKeywordRequest extends MineFormRequest
{
    public function saveRules(): array
    {
        return [
            'title' => 'required|max:120',
            'group_id' => 'required',
            'keyword' => 'required|max:120',
            'match_type' => 'required|in:0,1',
            'content' => 'required',
            'type' => 'required|in:0,1,2'
        ];
    }

    public function updateRules(): array
    {
        $data = array_merge($this->saveRules(), ['id' => 'required']);
        unset($data['type']);
        return $data;
    }


    public function deleteRules(): array
    {
        return [
            'id' => 'required'
        ];
    }

    public function searchKeywordsRules(): array
    {
        return [
            'keyword' => 'required'
        ];
    }
}